package cn.edu.neusoft.wuguangsheng.flowerimpression.model;

import cn.edu.neusoft.wuguangsheng.flowerimpression.bean.SuccessBean;
import cn.edu.neusoft.wuguangsheng.flowerimpression.iface.AddUserAddressIface;
import cn.edu.neusoft.wuguangsheng.flowerimpression.listener.TListener;
import cn.edu.neusoft.wuguangsheng.flowerimpression.service.AllService;
import retrofit2.Call;
import retrofit2.Retrofit;

public class AddUserAddressModel extends RetrofitBaseModel implements AddUserAddressIface<SuccessBean> {

    private AllService allService;
    private Retrofit retrofit;
    public AddUserAddressModel(){
        retrofit=getRetrofit();
        allService=getAllService();
    }
    @Override
    public void addUserAddress(String userid, String username, String userphone, String youbian, String city,String address, TListener<SuccessBean> tListener) {
        Call<SuccessBean> call = allService.addUserAddress(userid,username,userphone,youbian,city,address);
        callenqueue(call,tListener);
    }

    @Override
    public void updateUserAddress(String useraddressid, String username, String userphone, String youbian, String city,String address, TListener<SuccessBean> listener) {
        Call<SuccessBean> call = allService.updateUserAddress(useraddressid,username,userphone,youbian,city,address);
        callenqueue(call,listener);
    }

    @Override
    public void deleteUserAddressById(String userid, String useraddressid, TListener<SuccessBean> successBeanTListener) {
        Call<SuccessBean> call = allService.deleteUserAddressById(userid,useraddressid);
        callenqueue(call,successBeanTListener);
    }
}
